<template>
  <div>
    <bread class="filter">
      <h1>科研绩效考核</h1>
      <div class="filter-block">
        <normal-filter
          :label="filters.text"
          @change="handleLanguage"
          :options="filters.dataset">
        </normal-filter>
      </div>
      <div class="pull-right">
        <el-dropdown size="small" split-button type="success">
          导出Excel
          <el-dropdown-menu slot="dropdown">
            <el-dropdown-item>黄金糕</el-dropdown-item>
          </el-dropdown-menu>
        </el-dropdown>
      </div>
    </bread>
    <pageContent hasPagination hasFixedBottom>
      纵向项目管理
    </pageContent>

    <pagination
      :total="total"
      :page-size="pageSize"
      @changePage="fetchData">
    </pagination>
  </div>

</template>

<script>
import pagination from 'components/pagination';
import NormalFilter from 'components/NormalFilter';

export default {
  name: 'hello',
  data () {
    return {
      tableHead: [
        {
          cn: '学院',
          en: 'a',
        },
        {
          cn: '提交状态',
          en: 'b',
        },
        {
          cn: '考核周期',
          en: 'c',
        },
        {
          cn: '总人数',
          en: 'd',
        },
        {
          cn: '考核人数',
          en: 'e',
        },
        {
          cn: '院总值',
          en: 'f',
        },
        {
          cn: '人均值',
          en: 'g',
        },
        {
          cn: '最近提交时间',
          en: 'h',
        },
        {
          cn: '备注',
          en: 'i',
        },
      ],
      tableData: [
        {
          a: '中国语言文学系',
          b: 1,
          c: '2018-01-01至2018-02-01',
          d: '50',
          e: '16/25',
          f: '-',
          g: '-',
          h: '2018-04-24',
          i: '与去年相比有所增加',
        },
        {
          a: '社会学与人类学学院',
          b: 0,
          c: '2017-01-01至2017-02-01',
          d: '47',
          e: '已完成',
          f: '33000',
          g: '600',
          h: '2018-04-19',
          i: '加强高水平成果产出',
        },
      ],
      total: 1000,
      pageSize: 30,
      filters: {
        dataset: [{txt: '全部', val: '0'}, {txt: '中文成果', val: '1'}, {txt: '英文成果', val: '2'}],
        text: '语言'
      }
    }
  },
  methods: {
    getColumnWidth(item) {
      switch (item.en) {
      case 'b':
      case 'd':
      case 'e':
      case 'f':
      case 'g':
        return 100;
      case 'h':
        return 120;
      }
    },
    fetchData(page) {
      // console.log(page);
    },
    openMessageBox() {
      this.$confirm('点击确认后，将向学院管理员发送考核提交提醒通知。', '提醒学院提交考核', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        });
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        });
      });
    },
    handleLanguage() {

    },
  },
  components: {
    pagination,
    NormalFilter
  }
};
</script>
<style scoped lang="scss">
  .primary-color {
    color: var(--success-color);
  }
</style>
